package com.briup.api.client;

import com.briup.api.client.fallback.ItemClientFallbackFactory;
import com.briup.api.po.Goods;
import com.briup.api.po.dto.OrderItemInsertDTO;
import com.briup.api.po.vo.GoodsGetDetailVO;
import com.briup.common.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

@FeignClient(value = "bstore-item",
            fallbackFactory = ItemClientFallbackFactory.class)
public interface ItemClient {
    @GetMapping("/goods/batch")
    List<Goods> queryItemByIds(@RequestParam("ids") Collection<Integer> ids);

    @PutMapping("/goods/updateStock")
    void updateStock(@RequestBody List<OrderItemInsertDTO> items);

    @GetMapping("/goods/{id}")
    Result<GoodsGetDetailVO> queryItemById(@PathVariable Integer id);
}
